<?php
if (!defined("_INDEX")) { header("Location: /"); die; }

if ($company_id = $route->getAdminId()){
	$db->sendQuery("delete from `assets` where `company_id` = '$company_id'");
	$db->sendQuery("delete from `charter_capital` where `company_id` = '$company_id'");
	$db->sendQuery("delete from `profits` where `company_id` = '$company_id'");
	$db->sendQuery("delete from `providers` where `company_id` = '$company_id'");
	$db->sendQuery("delete from `companies` where `company_id` = '$company_id' limit 1");
}

goToPage("/admin/companies");
?>